<?php
	####################################################
	# library import and object instance.              #
	####################################################
	include_once('./common.php');


	####################################################
	# request data($_POST AND $_GET FROM $_REQUEST)    #
	####################################################
	# REQUEST(get and post variables)

	# GET(url variables)

	# POST(form variables)

	# Validation(special case validate)

	####################################################
	# implementation                                   #
	####################################################
	//*/
	# 멤버 정보를 가져 온다.
	if($sess['has']){
		$ret = $db->get(
			sprintf("SELECT * FROM `n_member` WHERE `muid`='%s'", $sess['res']['session_val']['muid'])
		);
	} else {
		Mover::error("올바르지 않은 접근", NULL, TRUE);
	}
	//*/
?>
<?php
	$html->custom_header(TITLE);
	$html->custom_js("{$JS}jquery.1.7.1.min.js");
	$html->custom_js("{$JS}lib.control.js");
	$html->custom_css("{$CSS}basic.css");
?>
<script type="text/javascript" language="javascript">
//<![CDATA[
	var PageAction = {
		validate:function(){
			//*/
			var check = [
				Validation.check_is_null("#memail", "이메일을 입력하세요."),
				Validation.check_is_email("#memail", "이메일을 형식에 맞게 입력하세요."),
				Validation.check_is_null("#mphone", "휴대전화를 입력하세요."),
				Validation.check_is_phone("#mphone", "휴대전화를 형식에 맞게 입력하세요."),
				Validation.check_is_do_not_select("#mjob", "직업을 선택하세요."),
				Validation.check_is_do_not_chooesed("msex", "성별을 선택하세요."),
				Validation.check_is_null_textarea("#mmsg", "가입인사를 입력하세요."),
				Validation.check_is_null("#mpasswd", "회원 정보 변경을 위해서는 비밀번호를 입력 하셔야 합니다.")
			];
			return Validation.check(check);
			//*/
		}
	}
//]]>
</script>
<?$html->custom_body();?>
<?=$tmp->tiles_header()?>
	<h1>회원정보</h1>
	<form id="formx" name="formx" method="post" action="./sign_member_info_change_proc.php" onsubmit="return PageAction.validate();">
		<table width="100%" border="1" cellspacing="3" cellpadding="0">
			<tr>
				<th>
					아이디
				</th>
				<td>
					<?=$ret['res']['mid']?>
				</td>
			</tr>
			<tr>
				<th>
					이메일
				</th>
				<td>
					<input type="text" name="memail" id="memail" maxlength="40" value="<?=$ret['res']['memail']?>" />
				</td>
			</tr>
			<tr>
				<th>
					휴대전화
				</th>
				<td>
					<input type="text" name="mphone" id="mphone" maxlength="40" value="<?=$ret['res']['mphone']?>"/>
				</td>
			</tr>
			<tr>
				<th>
					직업
				</th>
				<td>
					<select name="mjob" id="mjob">
						<option value="">직업선택</option>
						<option value="s" <?=NForm::selected($ret['res']['mjob'], "s")?>>학생</option>
						<option value="b" <?=NForm::selected($ret['res']['mjob'], "b")?>>회사원</option>
						<option value="e" <?=NForm::selected($ret['res']['mjob'], "e")?>>기타</option>
					</select>
				</td>
			</tr>
			<tr>
				<th>
					성별
				</th>
				<td>
					<label>
						<input type="radio" id="msex" name="msex" value="male" <?=NForm::checked($ret['res']['msex'], "male")?> /> 남성
					</label>
					<label>
						<input type="radio" id="msex" name="msex" value="female" <?=NForm::checked($ret['res']['msex'], "female")?> /> 여성
					</label>
				</td>
			</tr>
			<tr>
				<th>
					가입인사
				</th>
				<td>
					<textarea id="mmsg" name="mmsg" rows="5" cols="80"><?=$ret['res']['mmsg']?></textarea>
				</td>
			</tr>
			<tr>
				<th>
					비밀번호 입력
				</th>
				<td>
					<input type="password" name="mpasswd" id="mpasswd" /> * 회원 정보 변경을 위해서는 비밀번호를 입력 하셔야 합니다.
				</td>
			</tr>
			<tr>
				<th colspan="2">
					<?=NTool::submit_btn();?>
				</th>
			</tr>
		</table>
		<?=NTool::btn("비밀번호 변경", "Mover.href('./sign_passwd_change.php');");?>
	</form>
	<?=NTool::btn("뒤로", "Mover.back();");?>
	<?=NTool::btn("인덱스", "Mover.home();");?>
<?=$tmp->tiles_footer()?>
<?php $html->html_footer(); ?>